/**
 * Created by Wing on 2017/6/8.
 */
$(function () {
    var url = window.location.href;
    var menus= [
        {name:"个人首页",href:"/memorypalace/mypage/mypage.html"},
        {name:"学习列表",href:"/memorypalace/study/mystudy.html"},
        {name:"浏览牌组",href:"/memorypalace/mydeck.html"},
        {name:"知识体系",href:"/memorypalace/myknowledge.html"}
    ];
    var pattern1 = new RegExp("\/mypage\/*\.html");
    var result1 = url.match(pattern1);

    if(result1 != null && result1.length > 0){
        menus[0]["isActive"]="true";
    }
    var pattern2 = new RegExp("study");
    var result2 = url.match(pattern2);
    if(result2 != null && result2.length > 0){
        menus[1]["isActive"]="true";
    }
    var pattern3 = new RegExp("\/mydeck\/*\.html");
    var result3 = url.match(pattern3);
    if(result3 != null && result3.length > 0){
        menus[2]["isActive"]="true";
    }
    var pattern4 = new RegExp("\/myknowledge\/*\.html");
    var result4 = url.match(pattern4);
    if(result4 != null && result4.length > 0){
        menus[4]["isActive"]="true";
    }
    var menu1 = new Vue({
        el: "#menu1",
        data: {
            menus: menus
        }
    });

});